function zn
    cd ~/.config/nvim/lua/user/ && git pull &
end

function zf
    cd ~/.config/fish && git pull &
end

function zw
    cd ~/git_repo/utils/ && git pull &
end

if test (uname -s) = Darwin
    function pfd
        # 获取当前 Finder 窗口的目标路径
        osascript -e 'tell application "Finder"
            if (count of windows) > 0 then
                return POSIX path of (target of window 1 as alias)
            end if
        end tell' 2>/dev/null
    end
    # notify in future
    function no_update
        defaults write com.apple.SoftwareUpdate MajorOSUserNotificationDate -date "2030-02-07 23:22:47 +0000"
        defaults write com.apple.SoftwareUpdate UserNotificationDate -date "2030-02-07 23:22:47 +0000"
    end

    function cdf
        cd "$(pfd)"
    end
end
